import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: "/login"
},
{
    path: '/login',
    name: 'login',
    component: () => import(`@/views/login.vue`)
},
{
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    children: [
        {

            path: '/userList',
            name: 'userList',
            meta: {
                title: "用户列表"
            },
            component: () =>
                import(`@/views/user/userList.vue`)
        },
        {

            path: '/vipList',
            name: 'vipList',
            meta: {
                title: "会员等级"
            },
            component: () =>
                import(`@/views/user/vipList.vue`)
        },
        {
            path: '/shopList',
            name: 'shopList',
            meta: {
                title: "商品列表"
            },
            component: () =>
                import(`@/views/shop/shopList.vue`)
        },
                {
            path: '/shopClassific',
            name: 'shopClassific',
            meta: {
                title: "商品分类"
            },
            component: () =>
                import(`@/views/shop/shopClassific.vue`)
        },
                {

            path: '/orderList',
            name: 'orderList',
            meta: {
                title: "订单列表"
            },
            component: () =>
                import(`@/views/order/orderList.vue`)
        },
        {
            path: '/activityManagement',
            name: 'activityManagement',
            meta: {
                title: "公告管理"
            },
            component: () =>
                import(`@/views/operation/activityManagement.vue`)
        },
        {
            path: '/noticeList',
            name: 'noticeList',
            meta: {
                title: "帮助中心"
            },
            component: () =>
                import(`@/views/operation/noticeList.vue`)
        },
        {

            path: '/staffManagement',
            name: 'staffManagement',
            meta: {
                title: "员工管理"
            },
            component: () =>
                import(`@/views/system/staffManagement.vue`)
        },
        {

            path: '/authorityManagement',
            name: 'authorityManagement',
            meta: {
                title: "角色管理"
            },
            component: () =>
                import(`@/views/system/authorityManagement.vue`)
        },
       
    ]
}, {
    path: "*",
    redirect: '/login'
}

]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router